package com.eqxiu.ieditor.api.controller.file.doc;

import javax.servlet.http.HttpServletRequest;

import com.eqxiu.ieditor.commons.web.ResultData;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

@Api(description = "文件接口，获取uptoken等，保存文件信息")
public interface FileDoc {

	@ApiOperation(value = "获取上传token")
	public ResultData getUptoken(@ApiParam(required = false) String mediaType);

	@ApiOperation(value = "保存文件信息")
	@ApiImplicitParams(
		{ @ApiImplicitParam(name = "size", required = true, dataType = "long", paramType = "query"),
				@ApiImplicitParam(name = "path", required = true, dataType = "string", paramType = "query"),
				@ApiImplicitParam(name = "tmbPath", required = false, dataType = "string", paramType = "query"),
				@ApiImplicitParam(name = "bizType", required = true, dataType = "int", paramType = "query"),
				@ApiImplicitParam(name = "fileType", required = true, dataType = "int", paramType = "query"),
				@ApiImplicitParam(name = "libType", required = false, dataType = "int", paramType = "query"),
				@ApiImplicitParam(name = "tagId", required = false, dataType = "int", paramType = "query"),
				@ApiImplicitParam(name = "name", required = true, dataType = "int", paramType = "query"), }
	)
	public ResultData save(HttpServletRequest request);
	
	@ApiOperation(value = "远程抓取,并存入bucket中")
	public ResultData fetch(
			@ApiParam(required = true, name = "remoteURL", value = "文件地址", example = "http://baidu.com/aa.png") String remoteURL);

}
